package com.atguigu.mapreduce.solution;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class SolutionReducer extends Reducer<OrderBean, NullWritable, OrderBean, NullWritable> {

    @Override
    protected void reduce(OrderBean key, Iterable<NullWritable> values, Reducer<OrderBean, NullWritable, OrderBean, NullWritable>.Context context) throws IOException, InterruptedException {
        int i = 0;
        for (NullWritable value : values) {
            context.write(key, value);
            i++;
            if (i >= 3) {
                break;
            }
        }
    }
}
